Mapbox Docs Maps SDK for iOS Reference (5.13.0)

View on GitHub

Install in Dash

Mapbox Reference Styling the Map Reference
  • Appendices
    • Working with GeoJSON Data
    • Predicates and Expressions
    • Migrating to Expressions
    • For Style Authors
    • Tile URL Templates
    • Customizing Fonts
    • Info.plist Keys
    • Gesture Recognizers
  • Maps
    • MGLSettings
    • MGLMapCamera
    • MGLMapView
    • MGLMapViewDelegate
    • MGLMapSnapshot
    • MGLMapSnapshotOptions
    • MGLMapSnapshotter
    • MGLUserTrackingMode
  • Primitive Shapes
    • MGLAnnotation
    • MGLOverlay
    • MGLShape
    • MGLMultiPoint
    • MGLPointAnnotation
    • MGLPointCollection
    • MGLPolygon
    • MGLPolyline
    • MGLMultiPolygon
    • MGLMultiPolyline
    • MGLShapeCollection
  • Annotations
    • MGLAnnotationImage
    • MGLAnnotationView
    • MGLUserLocation
    • MGLUserLocationAnnotationView
  • User Interaction
    • MGLCalloutView
    • MGLCalloutViewDelegate
    • MGLCompassButton
  • Location Updates
    • MGLLocationManager
    • MGLLocationManagerDelegate
  • Styling the Map
    • MGLStyle
    • MGLLight
  • Style Primitives
    • MGLFeature
    • MGLPointFeature
    • MGLPointFeatureCluster
    • MGLPolygonFeature
    • MGLPolylineFeature
    • MGLMultiPolygonFeature
    • MGLMultiPolylineFeature
    • MGLPointCollectionFeature
    • MGLShapeCollectionFeature
    • MGLEmptyFeature
  • Style Content
    • MGLSource
    • MGLShapeSource
    • MGLComputedShapeSource
    • MGLTileSource
    • MGLRasterTileSource
    • MGLRasterDEMSource
    • MGLVectorTileSource
    • MGLImageSource
  • Style Layers
    • MGLStyleLayer
    • MGLForegroundStyleLayer
    • MGLBackgroundStyleLayer
    • MGLRasterStyleLayer
    • MGLVectorStyleLayer
    • MGLCircleStyleLayer
    • MGLFillStyleLayer
    • MGLFillExtrusionStyleLayer
    • MGLHeatmapStyleLayer
    • MGLHillshadeStyleLayer
    • MGLLineStyleLayer
    • MGLSymbolStyleLayer
  • Offline Maps
    • MGLOfflineRegion
    • MGLOfflineStorage
    • MGLOfflinePack
    • MGLOfflinePackProgress
    • MGLOfflinePackProgress
    • MGLOfflinePackState
    • MGLTilePyramidOfflineRegion
    • MGLShapeOfflineRegion
  • Geometry
    • MGLCoordinateBounds
    • MGLCoordinateBounds
    • MGLCoordinateBoundsEqualToCoordinateBounds
    • MGLCoordinateBoundsGetCoordinateSpan
    • MGLCoordinateBoundsIntersectsCoordinateBounds
    • MGLCoordinateBoundsIsEmpty
    • MGLCoordinateBoundsMake
    • MGLCoordinateBoundsOffset
    • MGLCoordinateInCoordinateBounds
    • MGLCoordinateQuad
    • MGLCoordinateQuad
    • MGLCoordinateQuadMake
    • MGLCoordinateQuadFromCoordinateBounds
    • MGLCoordinateSpan
    • MGLCoordinateSpan
    • MGLCoordinateSpanEqualToCoordinateSpan
    • MGLCoordinateSpanMake
    • MGLCoordinateSpanZero
    • MGLDegreesFromRadians
    • MGLRadiansFromDegrees
    • MGLStringFromCoordinateBounds
    • MGLStringFromCoordinateQuad
  • Formatters
    • MGLClockDirectionFormatter
    • MGLCompassDirectionFormatter
    • MGLCoordinateFormatter
    • MGLDistanceFormatter
  • Other Categories
    • NSExpression(MGLAdditions)
    • NSValue(MGLAdditions)
    • NSValue(MGLCircleStyleLayerAdditions)
    • NSValue(MGLFillExtrusionStyleLayerAdditions)
    • NSValue(MGLFillStyleLayerAdditions)
    • NSValue(MGLHillshadeStyleLayerAdditions)
    • NSValue(MGLLineStyleLayerAdditions)
    • NSValue(MGLRasterStyleLayerAdditions)
    • NSValue(MGLSymbolStyleLayerAdditions)
  • Other Classes
    • MGLAttributedExpression
    • MGLAttributionInfo
    • MGLDefaultStyle
    • MGLLoggingConfiguration
    • MGLMapProjection
    • MGLMapSnapshotOverlay
    • MGLNetworkConfiguration
    • MGLTileServerOptions
    • MGLUserLocationAnnotationViewStyle
  • Other Constants
    • MGLClusterIdentifierInvalid
    • MGLErrorDomain
    • MGLExpressionInterpolationModeCubicBezier
    • MGLExpressionInterpolationModeExponential
    • MGLExpressionInterpolationModeLinear
    • MGLFontColorAttribute
    • MGLFontNamesAttribute
    • MGLFontScaleAttribute
    • MGLMapViewDecelerationRateFast
    • MGLMapViewDecelerationRateImmediate
    • MGLMapViewDecelerationRateNormal
    • MGLMapViewPreferredFramesPerSecondDefault
    • MGLMapViewPreferredFramesPerSecondLowPower
    • MGLMapViewPreferredFramesPerSecondMaximum
    • MGLOfflinePackErrorNotification
    • MGLOfflinePackMaximumMapboxTilesReachedNotification
    • MGLOfflinePackProgressChangedNotification
    • MGLOfflinePackUserInfoKeyError
    • MGLOfflinePackUserInfoKeyMaximumCount
    • MGLOfflinePackUserInfoKeyProgress
    • MGLOfflinePackUserInfoKeyState
    • MGLShapeSourceOptionBuffer
    • MGLShapeSourceOptionClipsCoordinates
    • MGLShapeSourceOptionClusterProperties
    • MGLShapeSourceOptionClusterRadius
    • MGLShapeSourceOptionClustered
    • MGLShapeSourceOptionLineDistanceMetrics
    • MGLShapeSourceOptionMaximumZoomLevel
    • MGLShapeSourceOptionMaximumZoomLevelForClustering
    • MGLShapeSourceOptionMinimumZoomLevel
    • MGLShapeSourceOptionSimplificationTolerance
    • MGLShapeSourceOptionWrapsCoordinates
    • MGLTileSourceOptionAttributionHTMLString
    • MGLTileSourceOptionAttributionInfos
    • MGLTileSourceOptionCoordinateBounds
    • MGLTileSourceOptionDEMEncoding
    • MGLTileSourceOptionMaximumZoomLevel
    • MGLTileSourceOptionMinimumZoomLevel
    • MGLTileSourceOptionTileCoordinateSystem
    • MGLTileSourceOptionTileSize
    • MapboxVersionNumber
    • MapboxVersionString
  • Other Enumerations
    • MGLAnnotationVerticalAlignment
    • MGLAnnotationViewDragState
    • MGLAttributionInfoStyle
    • MGLCirclePitchAlignment
    • MGLCircleScaleAlignment
    • MGLCircleTranslationAnchor
    • MGLDEMEncoding
    • MGLErrorCode
    • MGLFillExtrusionTranslationAnchor
    • MGLFillTranslationAnchor
    • MGLHillshadeIlluminationAnchor
    • MGLIconAnchor
    • MGLIconPitchAlignment
    • MGLIconRotationAlignment
    • MGLIconTextFit
    • MGLIconTranslationAnchor
    • MGLLightAnchor
    • MGLLineCap
    • MGLLineJoin
    • MGLLineTranslationAnchor
    • MGLLoggingLevel
    • MGLMapDebugMaskOptions
    • MGLOrnamentPosition
    • MGLOrnamentVisibility
    • MGLRasterResamplingMode
    • MGLResourceKind
    • MGLSymbolPlacement
    • MGLSymbolZOrder
    • MGLTextAnchor
    • MGLTextJustification
    • MGLTextPitchAlignment
    • MGLTextRotationAlignment
    • MGLTextTransform
    • MGLTextTranslationAnchor
    • MGLTextWritingMode
    • MGLTileCoordinateSystem
    • MGLWellKnownTileServer
  • Other Protocols
    • MGLCluster
    • MGLComputedShapeSourceDataSource
    • MGLMapSnapshotterDelegate
    • MGLOfflineStorageDelegate
    • MGLStylable
  • Other Type Definitions
    • MGLAttributedExpressionKey
    • MGLBatchedOfflinePackAdditionCompletionHandler
    • MGLLoggingBlockHandler
    • MGLMapSnapshotCompletionHandler
    • MGLMapSnapshotOverlayHandler
    • MGLMapViewDecelerationRate
    • MGLMapViewPreferredFramesPerSecond
    • MGLOfflinePackAdditionCompletionHandler
    • MGLOfflinePackRemovalCompletionHandler
    • MGLOfflinePackUserInfoKey
    • MGLOfflinePreloadDataCompletionHandler
    • MGLShapeSourceOption
    • MGLSphericalPosition
    • MGLTileSourceOption
    • MGLTransition
  • Other Functions
    • MGLAltitudeForZoomLevel
    • MGLMapPointForCoordinate
    • MGLMapPointMake
    • MGLSphericalPositionMake
    • MGLTransitionMake
    • MGLZoomLevelForAltitude
  • Other Structures
    • MGLSphericalPosition
    • MGLTransition

Styling the Map

  • MGLStyle

    The proxy object for the current map style.

    MGLStyle provides a set of convenience methods for changing Mapbox default styles using MGLMapView.styleURL. Learn more about Mapbox default styles.

    It is also possible to directly manipulate the current map style via MGLMapView.style by updating the style’s data sources or layers.

    Note

    Wait until the map style has finished loading before modifying a map’s style via any of the MGLStyle instance methods below. You can use the -[MGLMapViewDelegate mapView:didFinishLoadingStyle:] or -[MGLMapViewDelegate mapViewDidFinishLoadingMap:] methods as indicators that it’s safe to modify the map’s style.

    Related examples

    See the Default styles example to learn how to initialize an MGLMapView object with a Mapbox default style using MGLStyle‘s class methods.

    See more

    Declaration

    Objective-C

    
    @interface MGLStyle : NSObject

    Swift

    class MGLStyle : NSObject
    View Source on GitHub
  • MGLLight

    An MGLLight object represents the light source for extruded geometries in MGLStyle.

    Example

    let light = MGLLight()
    let position = MGLSphericalPosition(radial: 5, azimuthal: 180, polar: 80)
    light.position = NSExpression(forConstantValue: NSValue(mglSphericalPosition: position))
    light.anchor = NSExpression(forConstantValue: "map")
    mapView.style?.light = light
    

    Related examples

    See the Adjust light of 3D buildings to learn how to create and modify the light source for 3D geometries.

    See more

    Declaration

    Objective-C

    
    @interface MGLLight : NSObject

    Swift

    class MGLLight : NSObject
    View Source on GitHub

License

Generated by jazzy ♪♫ v0.14.3, a Realm project.